<?php
require_once ('./Static/ArrayAssoc.php');

class ArticleView{
	private $getArticleKey = 'article';
	
	//returnerar artikelid
	public function GetArticleId(){
		return (isset($_GET[$this->getArticleKey])) ? $_GET[$this->getArticleKey] : null;
	}
	//returnerar html för utskrift av artiklar
	public function DoArticleBox($articleArray){
		$html = '';
		
		foreach ($articleArray as $value) {
			$html .= "<div class='wrapper'>
						<div style='float:left'>
							<b>".$value[ArrayAssoc::ARTICLE_HEADLINE]."</b>
						</div>
						<div style='float:right;'>
							Date written:  ".$value[ArrayAssoc::ARTICLE_DATE]."<br />
							Written by: ".$value[ArrayAssoc::ARTICLE_WRITER]."
						</div>
						<div class='clear'></div>	
						<div>
							".$value[ArrayAssoc::ARTICLE_DESC]."
						</div>
					</div>";	
		}
		return $html;

	}
}
?>